package com.trmp.commons.util;

import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;

import sun.misc.BASE64Encoder;

public class MD5Util
{
	public static String getMD5(String string) throws NoSuchAlgorithmException
	{
		MessageDigest md=MessageDigest.getInstance("MD5");
		byte[] bts=md.digest(string.getBytes());
		BASE64Encoder encoder=new BASE64Encoder();
		return encoder.encode(bts);
	}
}
